feat(github): Integrate action-prepare-release into Craft repo#667
Merged
feat(github): Integrate action-prepare-release into Craft repo#667
Conversation
663bd11 to
0c472be
Compare
Move the action-prepare-release GitHub Action into the Craft repository root,
enabling usage as `getsentry/craft@v2`. This provides better version alignment
and allows Craft to dogfood its own action.
- Add `floatingTags` config option to create/update floating tags (e.g., v2)
- Support placeholders: {major}, {minor}, {patch}
- Example: `floatingTags: ['v{major}']` creates v2 tag for version 2.15.0
- Parametrized inputs replacing hardcoded Sentry-specific values:
- `blocker_label` (default: release-blocker)
- `publish_repo` (default: ${{ github.repository_owner }}/publish)
- `git_user_name`, `git_user_email` (default to GITHUB_ACTOR)
- Smart Craft installation:
- Downloads from build artifact when in getsentry/craft repo
- Falls back to release download using github.action_ref
- Outputs resolved version for downstream steps
- build.yml: Add workflow_call trigger for reusability
- release.yml: Call build workflow first, then use local action for dogfooding
- Add `floatingTags: ['v{major}']` to github target in .craft.yml
Repos using `getsentry/action-prepare-release@v1` can migrate to:
```yaml
uses: getsentry/craft@v2
with:
version: auto
git_user_name: getsentry-bot # if needed
git_user_email: bot@sentry.io # if needed
```
Add a new `versioning` configuration option to `.craft.yml` that supports
`auto`, `manual`, and `calver` policies for version resolution.
## New Configuration
```yaml
versioning:
policy: auto | manual | calver # default based on minVersion
calver:
offset: 14 # days to go back (default: 14)
format: '%y.%-m' # strftime-like format (default: '%y.%-m')
```
## Behavior
- `craft prepare` (no arg): Uses `versioning.policy` from config
- `auto`: Analyze commits to determine bump type
- `manual`: Error if no version specified
- `calver`: Use calendar versioning
- `craft prepare calver`: Explicit CalVer override
- `craft prepare auto`: Explicit auto-versioning override
- `craft prepare 1.2.3`: Explicit version always works
## Policy Defaults
- `auto` if `minVersion >= 2.14.0`
- `manual` otherwise (backward compatible)
## New CLI Options
- `--calver-offset`: Override CalVer offset (days to go back)
## Environment Variables
- `CRAFT_CALVER_OFFSET`: Override CalVer offset
## CalVer Format
Supports strftime-like placeholders:
- `%y`: 2-digit year (e.g., "24")
- `%Y`: 4-digit year (e.g., "2024")
- `%m`: Zero-padded month (e.g., "01")
- `%-m`: Month without padding (e.g., "1")
- `%d`: Zero-padded day
- `%-d`: Day without padding
Example: `%y.%-m` produces "24.12" for December 2024
0c472be to
fce2ee0
Compare
Member
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
hubertdeng123
approved these changes
Dec 23, 2025
| description: 'Load .craft.yml from the specified remote branch instead of local file', | ||
| type: 'string', | ||
| }) | ||
| .option('calver-offset', { |
Member
There was a problem hiding this comment.
Under what circumstance would this be needed?
Member
Author
There was a problem hiding this comment.
For us, never as we always use the default value 14. But since Craft is meant to be a generic tool, some other folks may want to tweak this value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the action-prepare-release GitHub Action into the Craft repository root,
enabling usage as
getsentry/craft@v2. This provides better version alignmentand allows Craft to dogfood its own action.
Add
floatingTagsconfig option to create/update floating tags (e.g., v2)Support placeholders: {major}, {minor}, {patch}
Example:
floatingTags: ['v{major}']creates v2 tag for version 2.15.0Parametrized inputs replacing hardcoded Sentry-specific values:
blocker_label(default: release-blocker)publish_repo(default: ${{ github.repository_owner }}/publish)git_user_name,git_user_email(default to GITHUB_ACTOR)Smart Craft installation:
Outputs resolved version for downstream steps
build.yml: Add workflow_call trigger for reusability
release.yml: Call build workflow first, then use local action for dogfooding
Add
floatingTags: ['v{major}']to github target in .craft.ymlRepos using
getsentry/action-prepare-release@v1can migrate to: